import sys
sys.path.append("E:/workspace/SOMatch")

import matplotlib.pyplot as plt
import numpy as np
import cv2 as cv

def show_gray_img(img):
    plt.imshow(img, cmap='gray')
    plt.axis('off')
    plt.show()

if __name__ == '__main__':

    sar_img = "E:\\datasets\\sen1-2\\rois1868_summer\\s1_135\\ROIs1868_summer_s1_135_p488.png"
    img = plt.imread(sar_img)
    plt.imsave("E:/workspace/SOMatch/preprocess/sar_preprocess/org.png", img, cmap='gray')

    median_img = cv.medianBlur(img, 3)
    plt.imsave("E:/workspace/SOMatch/preprocess/sar_preprocess/median.png", median_img, cmap='gray')

    blur_img = cv.blur(img, (3,3))
    plt.imsave("E:/workspace/SOMatch/preprocess/sar_preprocess/blur.png", blur_img, cmap='gray')

    bil_img = cv.bilateralFilter(img, 3, 25, 25)
    plt.imsave("E:/workspace/SOMatch/preprocess/sar_preprocess/bilateralFilter_25.png", bil_img, cmap='gray')
